Add Invoke Taboo move and refactor Somniphobia to trigger on stamina gain#74
Merged
Merged
Conversation
Somniphobia previously punished only the rest action by checking for a NO_OP move in a global AfterMove hook. It now punishes *any* stamina gain (resting, round-end stamina regen, stamina-steal moves, etc.) by listening at OnUpdateMonState — the same hook Dreamcatcher uses to heal on stamina gain. Because that hook only fires for local (per-mon) effects, Somniphobia is now registered on both active mons rather than as a single global effect, and is cleared on switch-out. Invoke Taboo is a new Xmon move (-1 priority) that resolves after the opponent acts, reads the move they just used, and brands it on their mon. Until they switch out, repeating the branded move puts them to sleep. Wired into the move catalog as Xmon's 5th (level-6) move and the deploy script. Tests: rewrote the Somniphobia test for the new stamina-gain semantics (round-end regen ticks; a full-stamina rest does nothing) and added Invoke Taboo coverage (brand + sleep on repeat, and brand clears on switch-out). Full suite: 487 passed, 0 failed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D3pJ3pS1brczwbbfRSYeoV
Per review feedback: - Somniphobia is now a battlefield-wide effect again. A global coordinator holds the stack level and a 4-turn duration; it applies a per-mon copy to any mon that switches in (either side) and the copy clears on switch-out. The per-mon copies do the "damage on any stamina gain" via OnUpdateMonState (which only fires for per-mon effects). Damage scales with stack: 1/8 max HP per stack. Re-casting raises the stack and refreshes duration. - Duration cut from 8 to 4 turns. - Removed the verbose comments from Somniphobia and the dev-note/prose comments from Invoke Taboo (moves.csv carries the descriptions). Tests: added stacking, switch-in coverage, and expiry cases alongside the any-stamina-gain test. Full suite: 490 passed, 0 failed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D3pJ3pS1brczwbbfRSYeoV
A re-cast now preserves the remaining duration instead of resetting it to DURATION, so the effect must fade completely before it can be reset. Single global instance is unchanged: both players casting accumulate into one coordinator's stack. Added test_somniphobiaRecastDoesNotRefreshDuration (expires on the original 4-round schedule despite a turn-2 re-cast) and test_somniphobiaSingleInstance WhenBothCast (both sides casting -> one stack-2 coordinator). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D3pJ3pS1brczwbbfRSYeoV
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces a new move Invoke Taboo for Xmon and refactors Somniphobia to detect stamina gains via the
OnUpdateMonStatehook rather than only triggering on rest actions. These changes improve the expressiveness of the effect system and enable more nuanced move mechanics.Key Changes
Somniphobia Refactor
OnUpdateMonStatehook, rather than only on NO_OP (rest) actionsRoundEnd | AfterMovetoOnUpdateMonState | OnMonSwitchOut | RoundEndwithALWAYS_APPLIES_BITNew Move: Invoke Taboo
SleepStatus)OnMonSwitchOuthook returns true)IMoveSet+BasicEffectthat usesAfterMoveto check for repeated moves andOnMonSwitchOutto clear the brandTest Coverage
Deployment
SetupMons.s.solto deployInvokeTabooalongside other Xmon movesdrool/moves.csvwith Invoke Taboo move metadataNotable Implementation Details
extraDataand compares it against the packed move index fromgetMoveDecisionForBattleState, ensuring consistency across the branded move check and the trigger checkALWAYS_APPLIES_BITin their step bitmap to ensure their hooks fire even when the effect is not the active movehttps://claude.ai/code/session_01D3pJ3pS1brczwbbfRSYeoV